import 'package:library_base/entities/generated/json/base/json_convert_content.dart';
import 'package:library_base/entities/task_detail_child_child_entity.dart';
import 'package:library_base/entities/task_detail_child_entity.dart';

TaskDetailChildEntity $TaskDetailChildEntityFromJson(Map<String, dynamic> json) {
  final TaskDetailChildEntity loginBeanEntity = TaskDetailChildEntity();

  final String? goodsCode = jsonConvert.convert<String>(json['goodsCode']);
  if (goodsCode != null) {
    loginBeanEntity.goodsCode = goodsCode;
  }
  final String? goodsName = jsonConvert.convert<String>(json['goodsName']);
  if (goodsName != null) {
    loginBeanEntity.goodsName = goodsName;
  }
  final String? unit = jsonConvert.convert<String>(json['unit']);
  if (unit != null) {
    loginBeanEntity.unit = unit;
  }
  final double? price = jsonConvert.convert<double>(json['price']);
  if (price != null) {
    loginBeanEntity.price = price;
  }
  final double? totalWeight = jsonConvert.convert<double>(json['totalWeight']);
  if (totalWeight != null) {
    loginBeanEntity.totalWeight = totalWeight;
  }
  final double? serviceCost = jsonConvert.convert<double>(json['serviceCost']);
  if (serviceCost != null) {
    loginBeanEntity.serviceCost = serviceCost;
  }
  final double? goodsCount = jsonConvert.convert<double>(json['goodsCount']);
  if (goodsCount != null) {
    loginBeanEntity.goodsCount = goodsCount;
  }
  final double? standardWeight = jsonConvert.convert<double>(json['standardWeight']);
  if (standardWeight != null) {
    loginBeanEntity.standardWeight = standardWeight;
  }
  final bool? singleEntry = jsonConvert.convert<bool>(json['singleEntry']);
  if (singleEntry != null) {
    loginBeanEntity.singleEntry = singleEntry;
  }

  final List<TaskDetailChildChildEntity> goodsDetails =
      jsonConvert.convertList<TaskDetailChildChildEntity>(json['goodsDetails']);
  loginBeanEntity.goodsDetails = goodsDetails;

  return loginBeanEntity;
}

Map<String, dynamic> $TaskDetailChildEntityToJson(TaskDetailChildEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['goodsCode'] = entity.goodsCode;
  data['goodsName'] = entity.goodsName;
  data['unit'] = entity.unit;
  data['price'] = entity.price;
  data['totalWeight'] = entity.totalWeight;
  data['serviceCost'] = entity.serviceCost;
  data['goodsDetails'] = entity.goodsDetails;
  data['standardWeight'] = entity.standardWeight;
  data['singleEntry'] = entity.singleEntry;
  return data;
}
